module.exports = function(window, document) {
	var apivm = require('../../common/avm.min')(window, document);
	var avm = apivm;
	var api = apivm.api;
	var Component = apivm.Component;
	var $ = apivm.$;
	(function() {
	var Tpl = /*@__PURE__*/ (function(Component) {
		function Tpl(props) {
			Component.call(this, props);
			this.data = {
				text: "Hello APICloud",
				year: new Date().getFullYear()
			};
			this.compute = {
				list: function() {
					var apiNames = {
						version: "引擎版本",
						systemType: "系统类型",
						systemVersion: "系统版本",
						deviceModel: "设备型号",
						deviceName: "设备名称",
						operator: "运营商名称",
						connectionType: "网络状态",
						winName: "窗口名字",
						winWidth: "窗口宽度",
						winHeight: "窗口高度",
						appId: "应用ID",
						appName: "应用名称",
						appVersion: "应用版本"
					};

					return Object.entries(apiNames).map(function(item) {
						return item.concat([api[item[0]]]);
					});
				},
				version: function() {},
				systemType: function() {},
				systemVersion: function() {},
				deviceModel: function() {},
				deviceName: function() {},
				operator: function() {},
				connectionType: function() {},
				winName: function() {},
				winWidth: function() {},
				winHeight: function() {},
				appId: function() {},
				appName: function() {},
				appVersion: function() {}
			};
		}

		if (Component) Tpl.__proto__ = Component;
		Tpl.prototype = Object.create(Component && Component.prototype);
		Tpl.prototype.constructor = Tpl;
		Tpl.prototype.apiready = function() {
			api.setStatusBarStyle({style: "light", color: "-"});
		};
		Tpl.prototype.handleClick = function(e) {
			api.toast({
				msg: this.data.text,
				location: "middle"
			});
		};
		Tpl.prototype.render = function() {
			return apivm.h(
				"view",
				{class: "page"},
				apivm.h(
					"safe-area",
					{class: "header"},
					apivm.h("text", {class: "header__title"}, "APICloud")
				),
				apivm.h(
					"scroll-view",
					{class: "main"},

					apivm.h("text", {class: "h1", onClick: this.handleClick}, this.data.text),
					Object.entries(this.list).map(function(ref) {
						var ref_1 = ref[1];
						var key = ref_1[0];
						var name = ref_1[1];
						var value = ref_1[2];
						return apivm.h(
							"view",
							{class: "item"},
							apivm.h("text", {class: "item__text"}, name, ": ", value)
						);
					})
				),
				apivm.h(
					"safe-area",
					{class: "footer"},
					apivm.h("text", {class: "footer__text"}, "Copyright © "),
					apivm.h("text", {class: "footer__text"}, "2014"),
					apivm.h("text", {class: "footer__text"}, "-"),
					apivm.h("text", {class: "footer__text"}, this.data.year)
				)
			);
		};

		return Tpl;
	})(Component);
	apivm.define("tpl", Tpl);
	apivm.render(apivm.h("tpl", null), "body");
})();

	window['createApp'] = function() {
		apivm.$_start();
	}
	return avm;
}